package com.xls.box2023.jinbi.tixianjilu;


import android.app.Activity;
import android.content.Intent;
import android.view.View;
import android.widget.RelativeLayout;
import android.widget.TextView;

import androidx.recyclerview.widget.LinearLayoutManager;

import com.xls.box2023.R;
import com.xls.box2023.mvp.MVPBaseActivity;
import com.xls.xrecyclerview.XRecyclerView;


/**
 * MVPPlugin
 */

public class TiXianJiLuActivity extends MVPBaseActivity<TiXianJiLuContract.View, TiXianJiLuPresenter> implements TiXianJiLuContract.View, View.OnClickListener {

    private TextView title_text;
    private TextView title_back;
    private RelativeLayout title_rl_content;
    private XRecyclerView tixianjilu_list;

    public static void startActivity(Activity activity) {
        Intent intent=new Intent(activity, TiXianJiLuActivity.class);
        activity.startActivity(intent);
    }

    @Override
    public int getView() {
        return R.layout.activity_tixianjilu;
    }

    @Override
    public void initView() {

        title_text = findViewById(R.id.title_text);
        title_back = findViewById(R.id.title_back);
        title_rl_content = findViewById(R.id.title_rl_content);
        tixianjilu_list = findViewById(R.id.tixianjilu_list);
        title_back.setOnClickListener(this);
        title_text.setText("提现记录");
        setAdapter();
    }

    private void setAdapter() {
        tixianjilu_list.setLayoutManager(new LinearLayoutManager(this));
        tixianjilu_list.setAdapter(mPresenter.getTiXianJiLuAdapter());
        tixianjilu_list.setLoadingListener(mPresenter.getLoadingListener());
    }

    @Override
    public void onClick(View view) {
        if (view.getId() == R.id.title_back) {
            finish();
        }
    }

    @Override
    public XRecyclerView getListView() {
        return tixianjilu_list;
    }
}
